package net.mingsoft.dashboard.enums;

import org.apache.commons.lang3.StringUtils;

/**
 * @author gengfa
 * @date 22/01/26
 */
public enum SendTypeEnum {

    /**
     * EMAIL SMS
     */
    EMAIL("EMAIL", "邮件配置", "绑定邮件"),
    SMS("SMS", "短信配置", "绑定邮件");

    private String type;

    private String sendType;

    private String desc;

    SendTypeEnum(String type, String sendType, String desc) {
        this.type = type;
        this.sendType = sendType;
        this.desc = desc;
    }

    public static String getSendType(String type) {
        for (SendTypeEnum value : SendTypeEnum.values()) {
            if (StringUtils.equals(value.getType(), type)) {
                return value.getSendType();
            }
        }
        return null;
    }

    public static boolean isSms(String type) {
        return StringUtils.equals(type, SMS.getType());
    }

    public static boolean isEmail(String type) {
        return StringUtils.equals(type, EMAIL.getType());
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getSendType() {
        return sendType;
    }

    public void setSendType(String sendType) {
        this.sendType = sendType;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }
}
